package phapp.springSecurity;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

/**
 * 用户信息（用于spring security3）
 * 
 * @author 2012.10.05
 */
public class SpringAuthUser extends User
{
   private static final long serialVersionUID = 1L;

   private String userId;
   private String userName;
   private String userAccount;


   /**
    * 用户菜单信息
    */
   //private String userMenuInfo;
   /**
    * 用户Ip地址（在现实菜单时刷新IP信息）
    */
   //private String ip;
   
   /**
    * 组织机构代码,对应TG_DATA_ORGANIZATIONS_INFO表CP_CODE_字段
    */
   //private String cpCode;
   
   /**
    * 组织机构Id,对应TG_DATA_ORGANIZATIONS_INFO表id_字段
    */
   
   /**
    * 用户角色(多个角色以','隔开的)
    */
   
   //private String role;
   /**
    * 用户角色中文名(多个角色以','隔开的)
    */
   //private String roleName;

   /**
    * 公司简称,对应TG_DATA_ORGANIZATIONS_INFO表ABBREVIATION_字段
    */
   //private String abbreviation;
   
   /** 1-SI管理系统,2-SI自服系统,3-EC自服务系统,9-其它 */
   //String userNature;
   
   /**
    * 构造函数
    * 
    * @param username
    *           登录名
    * @param password
    *           登录密码
    * @param enabled
    *           启动、激活
    * @param accountNonExpired
    * @param credentialsNonExpired
    * @param accountNonLocked
    * @param authorities
    * @throws IllegalArgumentException
    */

   @SuppressWarnings("deprecation")
   public SpringAuthUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) throws IllegalArgumentException
   {

      super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
   }

   public static long getSerialVersionUID()
   {
      return serialVersionUID;
   }

   public String getUserId()
   {
      return userId;
   }

   public void setUserId(String userId)
   {
      this.userId = userId;
   }

   public String getUserName()
   {
      return userName;
   }

   public void setUserName(String userName)
   {
      this.userName = userName;
   }



   
   /*
   public String getUserMenuInfo()
   {
      return userMenuInfo;
   }

   public void setUserMenuInfo(String userMenuInfo)
   {
      this.userMenuInfo = userMenuInfo;
   }

   public String getRole()
   {
      return role;
   }

   public void setRole(String role)
   {
      this.role = role;
   }

   public String getRoleName()
   {
      return roleName;
   }

   public void setRoleName(String roleName)
   {
      this.roleName = roleName;
   }
   
   public String getAbbreviation()
   {
      return abbreviation;
   }

   public void setAbbreviation(String abbreviation)
   {
      this.abbreviation = abbreviation;
   }
   
   public String getUserNature()
   {
      return userNature;
   }

   public void setUserNature(String userNature)
   {
      this.userNature = userNature;
   }

   public String getIp()
   {
      return ip;
   }

   public void setIp(String ip)
   {
      this.ip = ip;
   }
   */
}
